package Hello_XML;

import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Grup:Hello
 * @Auther:cola
 * @Data:2021/4/17-2021-04-14:16
 * @version:1.0
 * 打印服务
 *
 */
public class Application2 {

    public static void main(String[] args) {
        //初始化spring容器
        ApplicationContext context=
                new ClassPathXmlApplicationContext("applicationContext.xml");
        //从容器中获取Messageprinter对象
        MessagePrinter printer = context.getBean(MessagePrinter.class);
        //打印消息
        printer.printMessage();
    }
}
